package com.example.study.model;

import com.example.study.model.group.Insert;
import com.example.study.model.group.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

@Data
@EqualsAndHashCode()
public class ClassVO implements Serializable {

    @NotNull(groups = {Update.class}, message = "班级ID不能为空")
    @ApiModelProperty(value = "班级ID")
    private Long id;
    @NotBlank(groups = {Insert.class}, message = "班级名称不能为空")
    @ApiModelProperty(value = "班级名称")
    private String className;
    @NotNull(groups = {Insert.class}, message = "班级容纳人数不能为空")
    @Min(value = 1, message = "班级人数不能小于1人")
    @Max(value = 999, message = "班级人数不能大于999人")
    @ApiModelProperty(value = "班级容纳人数")
    private int personNum;
}
